Broaden NPM detection for VS Code extensions#1801
Conversation
Context: microsoft#1348 Context: microsoft/vscode#295040 Commit a209393 added logic to ignore NPM dependencies declared in a package.json file if it belonged to a VS Code extension. This was done to ignore warnings for out of date package versions that are built directly into VS Code, however it also limits detection capabilities for all VS Code extension files. A change was made to bump the built in package versions in VS Code in commit microsoft/vscode@e987c52 which should allow us to revert this change and restore broader NPM detection for VS Code extensions.
There was a problem hiding this comment.
Pull request overview
This PR restores full npm package.json detection for VS Code extensions by removing the special-case logic that previously skipped packages declaring a vscode engine, aligning behavior with the updated VS Code built-in package versions.
Changes:
- Remove VS Code extension skip logic from
NpmComponentDetector(no longer ignoresengines.vscode). - Bump
NpmComponentDetectorversion to reflect the behavior change. - Update unit tests to assert that VS Code engine packages are detected (including the malformed
engines-as-array case).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Microsoft.ComponentDetection.Detectors/npm/NpmComponentDetector.cs |
Removes VS Code engine-based skip behavior and increments detector version. |
test/Microsoft.ComponentDetection.Detectors.Tests/NpmDetectorTests.cs |
Updates tests to expect detection for packages with engines.vscode (object and array cases). |
|
@RushabhBhansali Let me know if there is anything missing here or if there is anything I can do to help move this along, thanks. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1801 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
👋 Hi! It looks like you modified some files in the
If none of the above scenarios apply, feel free to ignore this comment 🙂 |
Context: #1348
Context: microsoft/vscode#295040
Commit a209393 added logic to ignore NPM dependencies declared in a
package.json file if it belonged to a VS Code extension. This was done
to ignore warnings for out of date package versions that are built
directly into VS Code, however it also limits detection capabilities for
all VS Code extension files.
A change was made to bump the built in package versions in VS Code in
commit microsoft/vscode@e987c52
which should allow us to revert this change and restore broader NPM
detection for VS Code extensions.